﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmailMarketingDao;
using Tool;

namespace EmailMarketingDomain
{
    public class One63PostOffice : ProxyPostOffice
    {
        private static One63PostOffice _one63PostOffice;
        private static readonly object _syncBoot = new object();
        private One63PostOffice()
        {
            var smtp = SmtpServerDao.GetEmailSmtpServcerByName("163");
            Mailconfig=new Mail();
            Mailconfig.SmtpServer.Host = smtp.Server;
            Mailconfig.SmtpServer.Port = Convert.ToInt32(smtp.Port);
            Mailconfig.SmtpServer.EnableSsl = smtp.EnableSSL;
        }
        public static One63PostOffice GetInstance()
        {
            if (_one63PostOffice == null)
            {
                lock (_syncBoot)
                {
                    if (_one63PostOffice == null)
                    {
                        _one63PostOffice = new One63PostOffice();
                    }
                }
            }
            return _one63PostOffice;
        }
    }
}
